// utils/component/redPacketAnimation.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    money: {
      type: String,
      value: '0.00元'
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    hideBg: true,
    hide:false
  },

 
  /**
   * 组件的方法列表
   */
  methods: {
    confirm: function (e) {
      console.log("确认");
      this.setData({
        hideBg: true,
        hide: true
      })
    },
    separate: function (e) {
      
      this.animationView = wx.createAnimation({
        duration: 30,
        timingFunction: 'ease',
        delay: 50,
        transformOrigin: '50% 50%'
      })

      this.animationTop = wx.createAnimation({
        duration: 30,
        timingFunction: 'ease',
        delay: 1000,
        transformOrigin: '50% 50%'
      })
      this.animationBg = wx.createAnimation({
        duration: 10,
        timingFunction: 'ease',
        delay: 1000,
        transformOrigin: '50% 50%'
      })
      this.animationDetails = wx.createAnimation({
        duration: 10,
        timingFunction: 'ease',
        delay: 1000,
        transformOrigin:'50% 50%'
      })
      this.animationView.rotate(10).step();
      this.animationView.rotate(-10).step();
      this.animationView.rotate(10).step();
      this.animationView.rotate(-10).step();
      this.animationView.rotate(0).step();
      this.animationBg.opacity(1).step();
      this.animationView.scale(1.4, 1.4).step({ duration: 500 });
      this.animationTop.translateY(-500).step({ duration: 500 });
      this.animationDetails.translateY(-20).step({ delay: 1200, duration: 300 });
      this.setData({
        animationView: this.animationView.export(),
        animationTop: this.animationTop.export(),
        animationDetails: this.animationDetails.export(),
        hideBg:false,
      })
    }

  }
})
